package com.peisong.controller;

import com.peisong.domain.Result;
import com.peisong.utils.JwtUtil;
import com.peisong.utils.ThreadLocalUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/article")
public class ArticleController {
    @GetMapping("/list")
    public Result<String> list(@RequestHeader("token") String token){
        try {
            Map<String,Object> cliams = JwtUtil.parseToken(token);
            return Result.success("文章列表。。。。");
        } catch (Exception e) {
            return Result.error("请先登录");
        }
    }
}
